export interface Dict {
    name: string;
    comment: string;
    select: {
        label: string;
        value: string | number;
    }[];
}

export interface Config {
    outPath: string;
    outType: 'js' | 'ts'
    database: MysqlConfig | DMConfig;
    columns?: {
        name: string;
        comment: string;
        label: string;
        value: string;
    }
    transformer?: Transformer;
}

export interface DatabaseConfig {
    host: string;
    port: number;
    user: string;
    password: string;
    database: string;
    table: string;
}

export interface MysqlConfig extends DatabaseConfig {
    type: 'mysql'
}

export interface DMConfig extends DatabaseConfig {
    type: 'dm'
}

export type Transformer = (rows: Object[]) => Dict[];

export type GenFileFunc = (path: string, dicts: Dict[]) => Promise<void>;